package com.oocl.homework.format;

import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;

import com.oocl.homework.format.data.DataLoad;
import com.oocl.homework.format.view.MyView;

public class Controller {
	
	private MyView myView;
	
	private DataLoad dataLoad;
	
	
	public Controller() {
		myView = new MyView();
		dataLoad = new DataLoad();
		try {
			dataLoad.load(new Scanner(new File("data.txt")));
		} catch (FileNotFoundException e) {
			// log here
			e.printStackTrace();
		}
	}
	
	public void view() {
		
			myView.printView(dataLoad.getCustomers1());
			myView.printView(dataLoad.getCustomers2());
			xmlView();
		
	}
	
	public void xmlView() {
		myView.printXml(dataLoad.getCustomers1());
	}

}
